import React, { Component } from 'react'

import { PickerView } from 'antd-mobile'

import FilterFooter from '../../../../components/FilterFooter'


export default class FilterPicker extends Component {
  state = {
    value: this.props.value
  }
  render() {
    const { onCancle, onSave, province, col, type } = this.props
    return (
      <>
        {/* 选择器组件： */}
        <PickerView data={province} value={this.state.value} cols={col} onChange={val => this.setState({ value: val })} />

        {/* 底部按钮 */}
        <FilterFooter onCancel={() => onCancle(type)} onOk={() => onSave(type, this.state.value)} />
      </>
    )
  }
}
